package net.csdn.business.kanban.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ClassName KanbanStatus
 * @Description TODO
 * @Author liuzhisheng
 * @Date 2023/9/14
 **/
@Getter
@AllArgsConstructor
public enum FieldTypeEnums {
    TEXT(0,"Text","文本"),
    NUMBER(1,"Number","数字"),
    DATE(2,"Date","日期"),
    SINGLE_SELECT(3,"Single select","单选项"),
    ITERATION(4,"Iteration","迭代");
    final Integer code;
    final String value;
    final String msg;

    public static FieldTypeEnums ofCode(Integer code) {
        for (FieldTypeEnums type : FieldTypeEnums.values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("FieldTypeEnums param error");
    }
}
